from tkinter import*

print('введите начальную координату x:')
x = int(input())
print('введите начальную координату y:')
y = int(input())
print('введите коэффицент увеличения n:')
n = int(input())

coords = [0,0,20,0,20,20,40,20,40,0,60,0,60,20,60,40,40,40,20,40,0,40,0,20]

if n == 0 and x>=0 and x<=500 and y>=0 and y<=500:
    pass
else:
    if n>0 and 0*n+x>=0 and 0*n+y>=0 and 20*n+x<=500 and 20*n+y<=500:
        pass
    else:
        if n<0 and 20*n+x>=0 and 20*n+y>=0 and 0*n+x<=500 and 0*n+y<=500:
            pass
        else:
            print('размер фигуры превышает максимальный размер поля')
            exit()

root = Tk()
root.title('ит-марафон')
root.geometry('500x500')

c = Canvas(bg = 'white', width = 500, height = 500)
c.pack(anchor = CENTER, expand = 1)

c.create_polygon(coords[0] *n+x, coords[1] *n+y,
                 coords[2] *n+x, coords[3] *n+y,
                 coords[4] *n+x, coords[5] *n+y,
                 coords[6] *n+x, coords[7] *n+y,
                 coords[8] *n+x, coords[9] *n+y,
                 coords[10] *n+x, coords[11] *n+y,
                 coords[12] *n+x, coords[13] *n+y,
                 coords[14] *n+x, coords[15] *n+y,
                 coords[16] *n+x, coords[17] *n+y,
                 coords[18] *n+x, coords[19] *n+y,
                 coords[20] *n+x, coords[21] *n+y,
                 coords[22] *n+x, coords[23] *n+y)

root.mainloop()
